package com.note.api;

import com.note.service.UserService;
import com.note.sys.RemoteWorkService;
import com.note.vo.AjaxResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author yuhuan
 * @date 2025/3/19
 */
@RestController
@RequestMapping("/user")
public class UserController {

    private final UserService orderService;

    private final RemoteWorkService remoteWorkService;

    public UserController(UserService orderService, RemoteWorkService remoteWorkService) {
        this.orderService = orderService;
        this.remoteWorkService = remoteWorkService;
    }

    @GetMapping("name")
    public AjaxResult userName() {
        return AjaxResult.success(orderService.getName(1));
    }

    @GetMapping("getWork")
    public AjaxResult getWork() {
        return AjaxResult.success(remoteWorkService.workName());
    }
}
